<?php
declare (strict_types=1);

namespace app\exception;

class ValidateException extends \RuntimeException
{
    protected $error;

    public function __construct(array|string $error)
    {
        $this->error = $error;
        $this->message = is_array($error) ? implode(PHP_EOL, $error) : $error;
    }

    public function getError(): array|string
    {
        return $this->error;
    }
}
